<template>
  <div>
    <zeda-dialog
      v-model="visible"
      width="600px"
      title="查看详情"
      :before-close="handleClose"
    >
      <Title slot="green">
        <desc-base-info
          :data="info"
          :colnum-info="colnumInfo"
          align="right"
          :no-line-height="true"
          label-width="120px"
          class="base-info"
        ></desc-base-info>
      </Title>

      <form-button
        slot="footer"
        cancel-text="关闭"
        :show-submit-button="false"
        @cancel="handleClose"
      ></form-button>
    </zeda-dialog>
  </div>
</template>
<script>
import request from "@/utils/request";
import FormButton from "@/components/FormButton";
export default {
  components: {
    FormButton,
  },
  props: {
    visible: { type: Boolean, default: false },
    id: { type: [String, Number], default: "" },
  },
  data() {
    return {
      info: {},
      show: false,
    };
  },
  computed: {
    colnumInfo({ info }) {
      return [
        { label: "会商单位", prop: "realName" },
        { label: "实际能耗", prop: "loginName", unit: "kwh", colNum: 2 },
        { label: "实际电费", prop: "realName", unit: "元/kwh", colNum: 2 },
        { label: "额度超支率", prop: "loginName", unit: "%", colNum: 2 },
        { label: "预算超支率", prop: "realName", unit: "%", colNum: 2 },
        { label: "工作违规次数", prop: "loginName", colNum: 2 },
        { label: "参加会议人数", prop: "realName", colNum: 2 },
        { label: "会议主持人", prop: "loginName" },
        { label: "会商研判情况", prop: "loginName" },
        { label: "存在问题", prop: "loginName" },
        { label: "需专班协调", prop: "loginName" },
        { label: "典型案例", prop: "loginName" },
      ];
    },
  },
  watch: {
    visible(value) {
      if (value && String(this.id).length > 0) {
        this.getInfo();
      } else {
        this.model = {
          substation: "",
          identity: "",
          taxNum: "",
          code: "",
          switchStatus: "",
        };
      }
    },
  },
  methods: {
    getInfo() {
      this.info = {
        realName: "次哦",
        loginName: "的大结局",
        roleName: "次哦",
        substation: "的大结局",
      };
      // request({
      //   url: `/pro/clue/detail/${this.data.bid}`,
      //   method: "get",
      //   params: {
      //     mine: this.data.mine || 0,
      //   },
      // }).then((data) => {
      //   this.info = data;
      // });
    },
    handleClose(status) {
      this.$emit("close", typeof status === "boolean" ? status : false);
    },
  },
};
</script>
